<template>
  <u-tabbar
    :value="current"
    inactiveColor="#7B7B7B"
    activeColor="#2289FF"
    :border="true"
    zIndex="10"
  >
    <u-tabbar-item v-for="(item,index) in tabBarList" :key="index" :text="item.text" @click="change(item,index)"
                   :icon="current === index?item.selectIconPath:item.iconPath">
    </u-tabbar-item>
  </u-tabbar>
</template>

<script>
const TEACHER = [
  {
    text: "首页",
    iconPath: require("@/static/tabBar/home.png"),
    selectIconPath: require("@/static/tabBar/homeSelect.png"),
    path: "/pages/index/index"
  }, {
    text: "预约课程",
    iconPath: require("@/static/tabBar/myCourse.png"),
    selectIconPath: require("@/static/tabBar/myCourseSelect.png"),
    path: "/pages/subscribeCourse/subscribeCourse"
  }, {
    text: "我的",
    iconPath: require("@/static/tabBar/mine.png"),
    selectIconPath: require("@/static/tabBar/mineSelect.png"),
    path: "/pages/mine/mine"
  }
];

const USER = [
  {
    text: "首页",
    iconPath: require("@/static/tabBar/home.png"),
    selectIconPath: require("@/static/tabBar/homeSelect.png"),
    path: "/pages/index/index"
  }, {
    text: "我的课表",
    iconPath: require("@/static/tabBar/myCourse.png"),
    selectIconPath: require("@/static/tabBar/myCourseSelect.png"),
    path: "/pages/userCourse/userCourse"
  }, {
    text: "我的",
    iconPath: require("@/static/tabBar/mine.png"),
    selectIconPath: require("@/static/tabBar/mineSelect.png"),
    path: "/pages/mine/mine"
  }
];

const SELL = [
  {
    text: "首页",
    iconPath: require("@/static/tabBar/home.png"),
    selectIconPath: require("@/static/tabBar/homeSelect.png"),
    path: "/pages/index/index"
  }, {
    text: "客户",
    iconPath: require("@/static/tabBar/client.png"),
    selectIconPath: require("@/static/tabBar/clientSelect.png"),
    path: "/pages/client/client"
  }, {
    text: "我的",
    iconPath: require("@/static/tabBar/mine.png"),
    selectIconPath: require("@/static/tabBar/mineSelect.png"),
    path: "/pages/mine/mine"
  }
];


export default {
  name: "lr-tabBar",
  props: {
    current: {
      type: Number,
      required: true
    }
  },
  data(){
    return {
      tabBarList: USER,
    }
  },
  methods: {
    change(e, index){
      this.$emit('click', e, index);
    }
  }
}
</script>

<style scoped>

</style>
